home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / openoffice / program / unopkg < prev    next >
Encoding:
Text File  |  2007-04-10  |  4.0 KB  |  147 lines

  1. #!/bin/sh
  2. #*************************************************************************
  3. #
  4. #   OpenOffice.org - a multi-platform office productivity suite
  5. #
  6. #   $RCSfile: unopkg.sh,v $
  7. #
  8. #   $Revision: 1.5 $
  9. #
  10. #   last change: $Author: hr $ $Date: 2006/01/24 16:46:34 $
  11. #
  12. #   The Contents of this file are made available subject to
  13. #   the terms of GNU Lesser General Public License Version 2.1.
  14. #
  15. #
  16. #     GNU Lesser General Public License Version 2.1
  17. #     =============================================
  18. #     Copyright 2005 by Sun Microsystems, Inc.
  19. #     901 San Antonio Road, Palo Alto, CA 94303, USA
  20. #
  21. #     This library is free software; you can redistribute it and/or
  22. #     modify it under the terms of the GNU Lesser General Public
  23. #     License version 2.1, as published by the Free Software Foundation.
  24. #
  25. #     This library is distributed in the hope that it will be useful,
  26. #     but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. #     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  28. #     Lesser General Public License for more details.
  29. #
  30. #     You should have received a copy of the GNU Lesser General Public
  31. #     License along with this library; if not, write to the Free Software
  32. #     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  33. #     MA  02111-1307  USA
  34. #
  35. #*************************************************************************
  36.  
  37. # enable file locking
  38. SAL_ENABLE_FILE_LOCKING=1
  39. export SAL_ENABLE_FILE_LOCKING
  40.  
  41. # resolve installation directory
  42. sd_cwd="`pwd`"
  43. if [ -h "$0" ] ; then
  44.     sd_basename=`basename "$0"`
  45.      sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` 
  46.     cd "`dirname "$0"`"
  47.     cd "`dirname "$sd_script"`"
  48. else
  49.     cd "`dirname "$0"`"
  50. fi
  51.  
  52. sd_prog="`pwd`"
  53.  
  54. cd ..
  55. sd_binary=`basename "$0"`".bin"
  56. sd_inst="`pwd`"
  57.  
  58. # change back directory
  59. cd "$sd_cwd"
  60.  
  61. # check if all required patches are installed
  62. if [ -x "$sd_prog/sopatchlevel.sh" ]; then
  63.     "$sd_prog/sopatchlevel.sh"
  64.     if [ $? -eq 1 ]; then
  65.         exit 0
  66.     fi
  67. fi
  68.  
  69. # set search path for shared libraries
  70. sd_platform=`uname -s`
  71. case $sd_platform in
  72.   AIX)
  73.     LIBPATH=${sd_prog}${LIBPATH+:${LIBPATH}}
  74.     export LIBPATH
  75.     ;;
  76.  
  77.   Darwin)
  78.     DYLD_LIBRARY_PATH=${sd_prog}${DYLD_LIBRARY_PATH+:${DYLD_LIBRARY_PATH}}
  79.     export DYLD_LIBRARY_PATH
  80.     ;;
  81.  
  82.   HP-UX)
  83.     SHLIB_PATH=${sd_prog}:/usr/openwin/lib${SHLIB_PATH+:${SHLIB_PATH}}
  84.     export SHLIB_PATH
  85.     ;;
  86.  
  87.   IRIX*)
  88.     LD_LIBRARYN32_PATH=${sd_prog}${LD_LIBRARYN32_PATH+:${LD_LIBRARYN32_PATH}}
  89.     export LD_LIBRARYN32_PATH
  90.     ;;
  91.  
  92.   *)
  93.     LD_LIBRARY_PATH=${sd_prog}${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}
  94.     export LD_LIBRARY_PATH
  95.     ;;
  96. esac
  97.  
  98. #collect all bootstrap variables specified on the command line
  99. #so that they can be passed as arguments to javaldx later on
  100. for arg in $@
  101. do
  102.   case "$arg" in
  103.        -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
  104.   esac
  105. done
  106.  
  107. # extend the ld_library_path for java: javaldx checks the sofficerc for us
  108. if [ -x "$sd_prog/javaldx" ] ; then
  109.     java_ld_library_path=`"$sd_prog/javaldx" $BOOTSTRAPVARS`
  110.     if [ "$java_ld_library_path" != "" ] ; then
  111.         case $sd_platform in
  112.             AIX)
  113.                 LIBPATH=${java_ld_library_path}:${LIBPATH}
  114.                 ;;
  115.             Darwin)
  116.                 DYLD_LIBRARY_PATH=${java_ld_library_path}:${DYLD_LIBRARY_PATH}
  117.                 ;;
  118.             HP-UX)
  119.                 SHLIB_PATH=${java_ld_library_path}:${SHLIB_PATH}
  120.                 ;;
  121.             IRIX*)
  122.                 LD_LIBRARYN32_PATH=${java_ld_library_path}:${LD_LIBRARYN32_PATH}
  123.                 ;;
  124.             *)
  125.                 LD_LIBRARY_PATH=${java_ld_library_path}:${LD_LIBRARY_PATH}
  126.                 ;;
  127.         esac
  128.     fi
  129. fi
  130.  
  131. # misc. environment variables
  132. OPENOFFICE_MOZILLA_FIVE_HOME="$sd_inst/program"
  133. export OPENOFFICE_MOZILLA_FIVE_HOME
  134.  
  135. unset XENVIRONMENT
  136.  
  137. # uncomment line below to disable anti aliasing of fonts
  138. # SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
  139.  
  140. # set path so that other apps can be started just by name
  141. PATH="$sd_prog":$PATH
  142. export PATH
  143.  
  144. # execute binary
  145. exec "$sd_prog/$sd_binary" "$@"
  146.  
  147.